// $Id: DocumentEditor.java 52 2011-10-23 12:50:09Z huijzer@gmail.com $
package lime.browser.editor;

import lime.common.LimeException;
import lime.model.Document;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.forms.editor.FormEditor;

public class DocumentEditor extends FormEditor {
	
	public static final String ID = "lime.browser.editor.document";
	
	@Override
	public void init(IEditorSite site, IEditorInput input) throws PartInitException {
		super.init(site, input);
		
		DocumentInput documentInput = (DocumentInput) input;
		Document document = documentInput.getDocument();
		setPartName(document.getObjectName());
	}
	
	@Override
	protected void addPages() {
		try {
			addPage(new VersionsPage(this));
			addPage(new RenditionsPage(this));
			//addPage(new RelationsPage(this));
		} catch (PartInitException e) {
			throw new LimeException(e);
		}
		
	}

	@Override
	public void doSave(IProgressMonitor monitor) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void doSaveAs() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public boolean isSaveAsAllowed() {
		// TODO Auto-generated method stub
		return false;
	}

}
